import static java.lang.Thread.sleep;

/**
 * ReadWeather读取天气数据类
 * @author Erik
 * @version 0.1
 * @since JDK1.8  IDEA
 * 用于读取天气数据的线程
 *  读取天气线程类ReadWeather
属性为Weather类的对象，包括构造方法和run方法。
 */

public class ReadWeather implements Runnable{
    private Weather weather;
    ReadWeather(Weather weather){
        this.weather=weather;
    }

    @Override
    public void run() {
       for(int i=0;i<100;i++) {
           try {
               sleep(1000);
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
           weather.read();
       }
    }

}
